var app = getApp();

Page({
  data: {
    isLoginWXIF: true
  },
  onLoad: function() {
    var hasLogin = wx.getStorageSync('hasLogin');
    var isLogin = wx.getStorageSync('isLogined');
    if (hasLogin) {
      this.setData({
        isLoginWXIF: false
      })
      wx.redirectTo({
        url: "../inputbaseinfo/inputbaseinfo"
      })
    } else {
      this.setData({
        isLoginWXIF: true
      })
    }
  },
  getUserInfo: function (res) {
    if (res.detail.userInfo) {
      wx.setStorageSync('hasLogin', true);
      wx.setStorageSync('userInfo', res.detail);
      wx.redirectTo({
        url: "../inputbaseinfo/inputbaseinfo"
      })
    } else {
      wx.showToast({
        title: '请先授权',
        icon: 'none',
        duration: 3000
      })
    }
  }
})